package com.itheima.springbootinittest10.config;

import com.itheima.springbootinittest10.condition.ClassCondition;
import com.itheima.springbootinittest10.domain.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserConfig {

    @Bean
    @Conditional(ClassCondition.class)//这个类定义的是个条件,条件为真,则执行这个属性,否则不执行
    public User user(){
        return new User();
    }
}







































